package com.exception.demo01;

public class Test2 {
    public static void main(String[] args) {
        try {
            new Test2().test(1,0);
        } catch (ArithmeticException e) {
            e.printStackTrace();
        } finally {
        }

    }
    //假设这方法中，处理不了这个异常，方法抛出异常
    public void test(int a,int b)throws ArithmeticException{
        if(b==0){//throw throws
            throw new ArithmeticException();//主动抛出异常
        }
    }


}
// // Ctrl + alt + t